<?php
namespace PsiFramework\Classes\Util\Security\Model;

import("Classes.Model.Object");

use \PsiFramework\Classes\Model\Object;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * Classe pour les droits
 *
 * @package Classes.Util.Security.Model
 */
class SecurityUserRole extends Object
{

    protected /*IUser*/        $_user ;
    protected /*SecurityRole*/ $_role ;

    public function __construct(
        Object $user=null,
        Object $role=null
    )
    {
        $this->_user = $user ;
        $this->_role = $role ;
    }

    public function getId()
    {
        if (is_null($this->_user) && is_null($this->_role)) {
            return null ;
        } else {
            $id = array();
            if (!is_null($this->_user)) {
                $id["user"] = $this->_user ;
            }
            if (!is_null($this->_role)) {
                $id["role"] = $this->_role ;
            }
            return $id ;
        }
    }

    public function getUser()
    {
        return $this->_user ;
    }

    public function setUser(Object $user)
    {
        $this->_user = $user ;
    }

    public function getRole()
    {
        return $this->_role ;
    }

    public function setRole(Object $role)
    {
        $this->_role = $role;
    }

    public function toString()
    {

    }
}
